import {defineStore} from 'pinia'

export const useCountStore = defineStore('count',{
    //data
    state(){
        return {
            sum:1,
            address:'nj'
        }
    },
    //methods
    actions:{
        add_store(value:number){
            if (this.sum < 10) {
                this.sum += value
            }
        },
        minus_store(value:number){
            if (this.sum > 1) {
                this.sum -= value
            }
        }
    },


    //computed
    getters:{
        bigSum(state):number{
            return state.sum *10
        },
        upperAddress():string{
            return this.address.toUpperCase()
        }
    }
})